// vite.config.ts
import { defineConfig } from "file:///D:/jqlink/new-pc-cashier/node_modules/vite/dist/node/index.js";
import path from "node:path";
import electron from "file:///D:/jqlink/new-pc-cashier/node_modules/vite-plugin-electron/dist/simple.mjs";
import vue from "file:///D:/jqlink/new-pc-cashier/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import legacy from "file:///D:/jqlink/new-pc-cashier/node_modules/@vitejs/plugin-legacy/dist/index.mjs";
var __vite_injected_original_dirname = "D:\\jqlink\\new-pc-cashier";
function replaceNodeGlobals() {
  return {
    name: "replace-node-globals",
    transform(code, id) {
      if (id.includes("node_modules") && code.includes("__dirname")) {
        return {
          code: code.replace(/__dirname/g, 'import.meta.url ? new URL(".", import.meta.url).pathname : undefined'),
          map: null
        };
      }
    }
  };
}
var vite_config_default = defineConfig({
  plugins: [
    vue(),
    legacy({
      targets: ["defaults", "not IE 11"],
      additionalLegacyPolyfills: ["regenerator-runtime/runtime"],
      renderLegacyChunks: false,
      // 禁用重复渲染，只生成传统版本
      polyfills: [
        "es.symbol",
        "es.array.filter",
        "es.promise",
        "es.promise.finally",
        "es/map",
        "es/set",
        "es.array.for-each",
        "es.object.define-properties",
        "es.object.get-own-property-descriptor",
        "es.object.get-own-property-descriptors",
        "es.object.keys",
        "es.object.to-string",
        "web.dom-collections.for-each",
        "esnext.global-this",
        "esnext.string.match-all"
      ]
    }),
    electron({
      main: {
        // Shortcut of `build.lib.entry`.
        entry: "electron/main.ts",
        vite: {
          plugins: [replaceNodeGlobals()],
          build: {
            outDir: "dist-electron",
            rollupOptions: {
              external: ["better-sqlite3", "sqlite3"],
              output: {
                format: "es",
                entryFileNames: "main.js"
              }
            }
          }
        }
      },
      preload: {
        // Shortcut of `build.rollupOptions.input`.
        // Preload scripts may contain Web assets, so use the `build.rollupOptions.input` instead `build.lib.entry`.
        input: path.join(__vite_injected_original_dirname, "electron/preload.ts")
      },
      // Ployfill the Electron and Node.js API for Renderer process.
      // If you want use Node.js in Renderer process, the `nodeIntegration` needs to be enabled in the Main process.
      // See 👉 https://github.com/electron-vite/vite-plugin-electron-renderer
      renderer: process.env.NODE_ENV === "test" ? void 0 : {}
    })
  ],
  resolve: {
    alias: {
      "@": path.resolve(__vite_injected_original_dirname, "./src"),
      "@components": path.resolve(__vite_injected_original_dirname, "./src/components"),
      "@views": path.resolve(__vite_injected_original_dirname, "./src/views"),
      "@utils": path.resolve(__vite_injected_original_dirname, "./src/utils"),
      "@api": path.resolve(__vite_injected_original_dirname, "./src/api"),
      "@stores": path.resolve(__vite_injected_original_dirname, "./src/stores"),
      "@types": path.resolve(__vite_injected_original_dirname, "./src/types")
    }
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@use "@/styles/variables.scss" as *;`
      }
    }
  },
  server: {
    port: 3e3,
    host: true
  },
  envDir: path.resolve(__vite_injected_original_dirname, "./env")
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJEOlxcXFxqcWxpbmtcXFxcbmV3LXBjLWNhc2hpZXJcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZmlsZW5hbWUgPSBcIkQ6XFxcXGpxbGlua1xcXFxuZXctcGMtY2FzaGllclxcXFx2aXRlLmNvbmZpZy50c1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vRDovanFsaW5rL25ldy1wYy1jYXNoaWVyL3ZpdGUuY29uZmlnLnRzXCI7aW1wb3J0IHsgZGVmaW5lQ29uZmlnIH0gZnJvbSAndml0ZSdcclxuaW1wb3J0IHBhdGggZnJvbSAnbm9kZTpwYXRoJ1xyXG5pbXBvcnQgZWxlY3Ryb24gZnJv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